package com.zz.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.zz.entity.Memberships;
import com.zz.service.MembershipsService;

@RestController
public class MembershipsController {

@Autowired
MembershipsService membershipsService;
/**
 * 查看学生部门
 * @return
 */
@RequestMapping("/X-admin/findM")
public Object findAllM(){
	List<Memberships> list=membershipsService.findAll();
	Map<String, Object>map=new HashMap<String, Object>();
	map.put("code", 0);
	map.put("msg", "");
	map.put("data", list);
	map.put("count", null);
	return map;
	
}
@RequestMapping("/X-admin/deleteM")
public Integer delete(Integer id){
	
	
	return membershipsService.delete(id);
	
}
@RequestMapping("/X-admin/saveM")
public Integer saveM(Memberships m){
	
	
	return membershipsService.save(m);
	
}	
}
